package com.ywqf_api.base;


import com.ywqf_api.util.UUIDUtil;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by sunzhongyuan on 2017/9/20.
 */
public class BaseController {

    public Logger logger= LoggerFactory.getLogger(this.getClass());


    /**
     * 得到32位的uuid
     * @return
     */
    public String get32UUID(){

        return UUIDUtil.get32UUID();
    }

    /**
     * 得到request对象
     */
    public HttpServletRequest getRequest() {
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        return request;
    }


}
